home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '88 / Proceedings '88 / Feldt Advanced Mac Programming / File Manager / Exist test / ssgHFSlib.h < prev   
Encoding:
C/C++ Source or Header  |  1988-01-04  |  3.5 KB  |  137 lines  |  [TEXT/KAHL]

  1. /*
  2.         ssgHFSlib: Copyright © 1987 by small systems guild
  3.         
  4.         All rights reserved
  5.         
  6.         small systems guild
  7.         PO box 2751
  8.         Ann Arbor, MI 48106
  9.         (313) 996-4238
  10.         
  11.         File:         ssgHFSlib.h
  12.         Module:     dir search
  13.         Includes:    
  14.         Model:         LightSpeed C 2.11, Aztec C 1.06i
  15.         Target:     Macintosh Operating System
  16.         
  17.         Edit history ($Log$):
  18.             11/16/87    ebs    check for currently open files. Backup dates
  19.             11/03/87    DAF added file comments field
  20.             10/26/87    ebs added colormap
  21.             10/12/87     ebs changed structures a bit
  22.             10/9/87     ebs added fields to structures
  23.             10/8/87     ebs created from existing HFS libraries
  24.     
  25. */
  26.  
  27.  
  28.  
  29.     /* file open attributes */
  30. #define HFS_LOCKED        0
  31. #define HFS_RES_OPEN    0x4
  32. #define HFS_DATA_OPEN    0x8
  33. #define HFS_DIR            0x10
  34. #define HFS_OPEN        0x80
  35.  
  36.  
  37.     /* This structure contains fields unique to directories */
  38. typedef    struct
  39.     {
  40.     int            dir_id;                    /* Mac directory ID number */
  41.     int            parent;
  42. #ifdef CANT_HAVE_THIS
  43.     unsigned int        num_files;                /* number of immediate subfiles */
  44.     unsigned int        num_folders;            /* number of immediate subfolders */
  45.     unsigned int        num_appls;                /* number of imm executables (for display) */
  46.     unsigned int        tot_num_files;            /* number files in entire subtree */
  47.     unsigned int        tot_num_folders;        /* number folders in entire subtree */
  48.     unsigned long        tot_data_size;            /* data fork size for entire subtree */
  49.     unsigned long        tot_res_size;            /* res fork size for entire subtree */
  50.     unsigned int        depth;                    /* How many levels deep are we? */
  51.     /*struct FOLDER_INFO    *parent;*/        /* Pointer to parent node */
  52. #else
  53.     unsigned int        valence;                /* num files + folders in dir */
  54. #endif
  55.     } DIR_ONLY;
  56.  
  57.  
  58.     /* this structure contains fields unique to files */
  59. typedef struct
  60.     {
  61.     unsigned long        type;
  62.     unsigned long        creator;
  63.     int            icon_num;
  64.     int            path_ref;                /* Path if file is open */
  65.     unsigned char        cur_attr;                /* Open attributes */
  66.     } FILE_ONLY;
  67.     
  68. typedef struct
  69.     {
  70.     int            target_dir;                /* dirID to restore to */
  71.     int            target_vol;
  72.     unsigned long        create_time;
  73.     unsigned long        mod_time;
  74.     unsigned long        type;
  75.     unsigned long        creator;
  76.     unsigned    is_dir:1;                /* NOTE: 1=DIRECTORY NODE    0=QUALIFIER NODE */
  77.     unsigned    match_all:1;            /* if is_dir=0, this bit is same as a *.* node */
  78.     unsigned    search_subs:1;
  79.     unsigned    keep_tree:1;
  80.     unsigned    time_rel:3;
  81.     unsigned    use_create:1;            /* true = create time, else mod */
  82.     unsigned    name_cmp:2;                /* starts, ends, contains, equals */
  83.     unsigned    select_rule:1;            /* a select rule?  (else an unselect rule!) */
  84.     } MAC_QDATA;
  85.  
  86.     /* this structure is the combination of everything we need */
  87. typedef struct
  88.     {
  89.     unsigned char        name[50];
  90.     unsigned long        data_size, res_size;
  91.     unsigned long        create_time, mod_time, bak_time;
  92.     int            file_cmnt;
  93.     unsigned    icon_color:3;
  94.     unsigned    select_state:2;
  95.     unsigned    is_dir:1;                /* 1=directory  0=file */
  96.     unsigned    is_vol:1;
  97.     unsigned    is_tape:1;
  98.     union
  99.         {
  100.         FILE_ONLY    file;
  101.         DIR_ONLY    dir;
  102.         }info;
  103. #ifdef NEEDED
  104.         /* Qal info */
  105.     int            target_dir;                /* dirID to restore to */
  106.     int            target_vol;
  107.     unsigned    search_subs:1;
  108.     unsigned    keep_tree:1;
  109.     unsigned    time_rel:3;
  110.     unsigned    name_cmp:2;                /* starts, ends, contains, equals */
  111. #endif
  112.     } FILE_INFO;
  113.     
  114. typedef struct
  115.     {
  116.     unsigned char            name[50];    /* Pascal name */
  117.     int                refnum;
  118.     unsigned long            size;
  119.     unsigned        is_hfs:1;
  120.     unsigned        is_mfs:1;
  121.     unsigned        is_floppy:1;
  122.     } VOL_INFO;
  123.  
  124. typedef struct
  125.     {
  126.     int                num_vols;
  127.     VOL_INFO        vol[10];
  128.     } ALL_VOLS;
  129.  
  130. typedef struct
  131.     {
  132.     int                iconID;                    /* icon resource ID            */
  133.     int                refNum;                    /* volume reference number    */
  134.     unsigned char            name[50];        /* Pascal string vol name    */
  135.     } VolCell;
  136.     
  137.